/*                                    _
 *   ___ _ __ ___ _ __ ___   ___   __| |
 *  / __| '__/ __| '_ ` _ \ / _ \ / _` |
 *  \__ \ |  \__ \ | | | | | (_) | (_| |
 *  |___/_|  |___/_| |_| |_|\___/ \__,_|                                  
 *
 * |_  _ | _  _  _ _   _ _  _  _|   | _ 
 * | |(/_||_)(/_| _\  | | |(_)(_||_||(/_
 *        |                             
 */
 
stock Debug_SearchForFunction(Handle:conf, const String:functionName[])
{
	StartPrepSDKCall(SDKCall_Static);
	if(PrepSDKCall_SetFromConf(conf, SDKConf_Signature, functionName)) 
	{
		Debug_Print("Function '%s' initialized.", functionName);
	} 
	else 
	{
		Debug_Print("Function '%s' NOT FOUND.", functionName);
	}
	EndPrepSDKCall();
}

//Standard debug print
stock Debug_Print(const String:format[], any:...)
{
	#if SRS_DEBUG	|| SRS_DEBUG_LOG
	decl String:buffer[192];
	
	VFormat(buffer, sizeof(buffer), format, 2);
	
	#if SRS_DEBUG
	PrintToChatAll("[SRSDBG] %s", buffer);
	PrintToConsole(0, "[SRSDBG] %s", buffer);
	#endif
	
	LogMessage("%s", buffer);
	#else
	//suppress "format" never used warning
	if(format[0])
		return;
	else
		return;
	#endif
}

//Debug print for messages that are repeated continuously
stock Debug_PrintSpam(const String:format[], any:...)
{
	#if SRS_DEBUG_SPAM
	decl String:buffer[192];
	
	VFormat(buffer, sizeof(buffer), format, 2);
	
	PrintToChatAll("[SRSDBG] %s", buffer);
	PrintToConsole(0, "[SRSDBG] %s", buffer);
	LogMessage("%s", buffer);
	
	#else
	//suppress "format" never used warning
	if(format[0])
		return;
	else
		return;
	#endif
}

